
import 'babel-polyfill'
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import store from './store'
import '@/assets/css/icon.css';
import '@/assets/css/style.css';
import 'element-ui/lib/theme-chalk/index.css';
import { Countup,ToastPlugin,ConfirmPlugin ,LoadingPlugin } from 'vux'

import { Toast , Dialog } from 'vant';
Vue.prototype.$toast = Toast;
Vue.prototype.$dialog = Dialog; 

Vue.component('countup', Countup)   
Vue.use(ElementUI);
Vue.use(ToastPlugin)
Vue.use(ConfirmPlugin) 
Vue.use(LoadingPlugin) 
Vue.config.productionTip = false

// import Vconsole from 'vconsole'
//  const vConsole = new Vconsole()
//  export default vConsole
// import VueImageSwipe from 'vue-image-swipe'
// import 'vue-image-swipe/dist/vue-image-swipe.css'

// Vue.use (VueImageSwipe);


//store.dispatch('getShopList'); 
router.beforeEach((to, from, next) => {
  //设置返回主页
  if(( from.name=="Login" || !from.name ) && to.name!="Entirety" && to.name!="Index" ){
    store.commit("setShowIndex",true);
  }else{
    store.commit("setShowIndex",false);
  }
  next();
})
function GetRequest() { 
	var url = location.search; 
	var theRequest = new Object(); 
	if (url.indexOf("?") != -1) {
		var str = url.substr(1); 
		strs = str.split("&"); 
		for(var i = 0; i < strs.length; i ++) {
			theRequest[strs[i].split("=")[0]]=decodeURLcomponent(strs[i].split("=")[1]); 
		} 
	} 
	return theRequest; 
} 

new Vue({
  el: '#app',
  router,
  store,
  components: { App },
  template: '<App/>'
})
